package edu.its.dreamteam.daf.dao.ibatis;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import edu.its.dreamteam.daf.beans.BuyPlayer;
import edu.its.dreamteam.daf.beans.SellPlayer;
import edu.its.dreamteam.daf.dao.IBuyPlayerDao;

public class BuyPlayerDaoImpl extends BaseDaoImpl implements IBuyPlayerDao {

	@Override
	protected String getNamespace() {
		return "BuyPlayer";
	}

	public List<BuyPlayer> getBuyPlayerByTeam(String id_team, String id_room) {
		try {
			Map map = new HashMap();
			map.put("id_team",id_team);
			map.put("id_room",id_room);
			
			List<BuyPlayer> list = getSqlMapClientTemplate().queryForList(getNamespace()+".getBuyPlayerByTeam", map);
			return list;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	public List<BuyPlayer> getBuyPlayerNotTeam(String id_team, String id_room) {
		try {
			Map map = new HashMap();
			map.put("id_team",id_team);
			map.put("id_room",id_room);
			
			List<BuyPlayer> list = getSqlMapClientTemplate().queryForList(getNamespace()+".getBuyPlayerNotTeam", map);
			return list;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

}
